local telageral, opcao
while .t.
 legal(11,10,18,40,'Tabelas Auxiliares','Esc-Sai')
 @ 13,12 prompt ' 1 - Retencoes             '
 @ 14,12 prompt ' 2 - Bancos                '
 @ 15,12 prompt ' 3 - Carimbos              '
 @ 16,12 prompt ' 4 - Tipos de Servicos     '
 telageral = savescreen(3,0,24,80)
 menu to opcao
 do case
    case opcao = 1
         do retencao
    case opcao = 2
         do bancos  
    case opcao = 3
         carimbos()
    case opcao = 5
         do tiposerv
    case lastkey() = 27 .or. opcao = 0
         exit
 endcase
 restscreen(3,0,24,80,telageral)
enddo

function carimbos()
legal(9,0,20,79,'Carimbos','Esc-Sai')
sele carimbo
mcarimboa   = carimboa
mcarimboa01 = carimboa01
mcarimbos   = carimbos
mcarimbos01 = carimbos01
@ 10,1 say 'Matriz - Adm' 
@ 11,1  get mcarimboa  pict '@K60!'
@ 12,1 say 'Filial - Adm' 
@ 13,1  get mcarimboa01 pict '@K60!'

@ 15,1 say 'Matriz - Seguranca'  color 'r*/w'
@ 16,1  get mcarimbos   pict '@K60!'
@ 17,1 say 'Filial - Seguranca'  color 'r*/w'
@ 18,1  get mcarimbos01 pict '@K60!'

read
if alteracao()
   repla carimboa   with mcarimboa
   repla carimboa01 with mcarimboa01
   repla carimbos   with mcarimbos
   repla carimbos01 with mcarimbos01
   unlock
endif
retu 

